package com.uci.photogam;

import android.content.Context;
import android.graphics.Color;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

public class AdapterMainMenu extends BaseAdapter {
	private Context mContext;
	private int width, height;
	private String texts[];

	public AdapterMainMenu(Context c, String[] texts, DisplayMetrics metrics) {
		mContext = c;
		width = metrics.widthPixels;
		height = metrics.heightPixels;
		this.texts = texts;
	}

	public int getCount() {
		return texts.length;
	}

	public Object getItem(int arg0) {
		return texts[arg0];
	}

	public long getItemId(int arg0) {
		return arg0;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		TextView txtView;
		if (convertView == null) {
			txtView = new TextView(mContext);
			txtView.setLayoutParams(new GridView.LayoutParams(
					(int) (width / 2.4), (int) (height / 4.3)));
		} else {
			txtView = (TextView) convertView;
		}
		txtView.setBackgroundColor(Color.GRAY);
		txtView.setPadding(5, 5, 0, 5);
		txtView.setText(texts[position]);
		txtView.setTextSize(23);
		txtView.setTextColor(Color.WHITE);
		return txtView;
	}

	static class ViewHolder {

	}
}
